<template>
  <el-container>
    <el-header>
      <div class="search" @clicl='search'>
           <input id='input' type="text" placeholder="搜索需要的产品">
            <i class="el-icon-search"></i>
        </div>
    </el-header>
    <el-main>
      <div style="background-color:#f0f0f0">
        <el-carousel height="200px">
          <el-carousel-item  v-for="(item,index) in imgList" :key="index">
            <img :src="'/static/images/'+item" style="width:100%;height:100%">
          </el-carousel-item>
        </el-carousel>
      </div>
      <div class="line"></div>
      <!-- 中间导航栏 -->
      <el-row :gutter="20">
        <el-col :span="6" v-for="(p,index) in daoList" :key="index">
          <div class="grid-content bg-purple">
            <img :src="'/static/images/'+p[0]" alt="" class="daohang">
            <div>{{p[1]}}</div>
          </div>
        </el-col>
      </el-row>
      <!-- 分隔条 -->
      <div class="line"></div>
      <div class="saodi">
        <div>
          <div>PJ-01扫地机器人</div>
          <div>精密激光测距，只能规划</div>
        </div>
        <img src="/static/images/star_product01.png" alt="">
      </div>
    <!-- 分隔条 -->
      <div class="line"></div>
      <!-- 只能产品3 -->
      <div class="chan3">
        <div>
          <div>智能运动</div>
          <div>监测心率步数</div>
        </div>
        <div>
          <div>智能摄像</div>
          <div>清晰省电</div>
        </div>
        <div>
          <div>智能家居</div>
          <div>生物指纹</div>
        </div>
      </div>
      <!-- 分隔条 -->
      <div class="line"></div>
      <!-- 智能产品 -->
      <div class="chanpin">
        <p>--  智能产品  --</p>
        <div v-for="(q,index) in chanpin" class="shangpin">
          <img :src="'/static/images/'+q[0]" alt="">
          <div>{{q[1]}}</div>
          <div>￥{{q[2]}}</div>
        </div>
      </div>
       <!-- 分隔条 -->
      <div class="line"></div>
      <!-- 每日精选 -->
      <div class="jingxuan">
        <div>每日精选</div>
        <div>
          <div>高清无线打印机</div>
          <div>到手价:￥700</div>
        </div>
        <img src="/static/images/dyj.png" alt="">
      </div>
      <!-- 分隔条 -->
      <div class="line"></div>
      <!-- 活动 -->
      <div class="active">
        <p>-- 优惠活动 -- </p>
        <div v-for="m in huodong"  class="act" v-bind:style="{left:m[4]*160+'px'}">
          <img :src="'/static/images/'+m[0]" alt="" >
          <!-- 倒计时 -->
          <div></div>
          <!-- 商品名 -->
          <div>{{m[1]}}</div>
          <!-- 金额 -->
          <div>￥{{m[2]}}</div>
          <!-- 原价 -->
          <div>￥{{m[3]}}</div>
          <!-- 抢 定位 -->
          <div>抢</div>
        </div>
      </div>
      <div class="more"></div>
    </el-main>
  </el-container>
</template>
<script>
export default {
    data(){
      return{
        imgList:["home_bg_scroll01.png","home_bg_scroll02.png"],
        daoList:[["king.png","新品推荐"],["zhongchou.png","众筹产品"],["temai.png","超值特卖"],["huanxin.png","以旧换新"]],
        chanpin:[["home_product01.png","智能摄像机云台版","1600"],["home_product02.png","PJ-1 运动手环","270"],["ai_product02.png","TEMPLATE空气净化器","1500"],["home_product04.png","PH-1智能手表","300"]],
         huodong:[["ai_TV.png","商品详情高清电视4A32英寸","2700.00","3000",0],["ai_ice.png","激光投影电视150英寸","7500","8000",1],["ai_mi.png","蓝牙音箱mini","180","200",2]],
      }
    },
    methods:{
      //搜索页面
      search(){
        this.$router.push('Details');
      }
    }
}
</script>
<style lang="scss" scoped>
.el-header{
  width: 100%;
  height: 60px;
  background-color: rgb(255,138,69);
  .search{
  height: 35px;
  margin-top: 10px;
  background-color: #fff;
  border-radius: 20px;
  input{
    margin-left: 15px;
    font-size: 18px;
    height: 35px;
    line-height: 35px;
    width: 85%;
    color: #999;
    text-indent: 0.4rem;
    border: none;
    outline: none;
  }
  i{
    color:  rgb(255,138,69);
  }
}
}
.el-main{
  padding: 10px 0 !important ;
  .el-carousel{
    background-color: #f0f0f0;
  }
  //分隔条
  .line{
    height: 10px;
    background-color: #f0f0f0;
  }
  //中间导航栏
  .el-row {
    text-align: center;
    box-sizing: border-box;
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .el-col {
    border-radius: 4px;
    padding: 0 !important;
    margin: 0 !important;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    height:50px;
  }
  .bg-purple-light {
    background: #e5e9f2;

  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
    height: 100px;
  }
  .row-bg {
    background-color: #f9fafc;
  }
  .daohang{
    padding-top:15px ;
    width: 40px;
    height: 40px;
  }
  .daohang+div{
    font-weight: 900;
    padding-top:10px;
    font-size: 16px;
  }
    // 扫地机器人
  .saodi{
    width: 100%;
    height: 120px;
    background:url("/static/images/bg_red.png");
  }
  .saodi>div{
    float: left;
    margin: 40px 0 0 40px;
  }
  .saodi>div div:nth-child(1){
    text-align: center;
    border-radius: 10px;
    background-color:#fff;
    font-size: 20px;
    font-weight: bold;
  }
  .saodi>div div:nth-child(2){
  font-size: 16px;
  }
  .saodi img{
    width:90px;
    height: 90px;
    float: right;
    margin-top: 15px;
    margin-right: 40px;
  }
  // 3个产品栏
  .chan3{
    padding:  20px 15px 20px 15px;
    height: 160px;
  }
  .chan3>div:nth-child(1){
    border-radius: 15px;
    float: left;
    background: url("/static/images/ai_watch.png");
    background-size: contain;
    width: 160px;
    height: 160px;
  }
  .chan3>div:nth-child(1) div:nth-child(1){
    padding-top: 10px;
    margin-left: 40px;
    font-weight: bold;
    font-size: 16px;
  }
  .chan3>div:nth-child(1) div:nth-child(2){
    font-size: 16px;
    margin-left: 25px;
    color:#96abb4;
  }
  .chan3>div:nth-child(2){
    background-color: #e8ebf4;
    background-size: contain;
    margin-left: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    width: 160px;
    height: 70px;
    float: left;
  position: relative;
  }
  .chan3>div:nth-child(2) div:nth-child(1){
    padding-top: 10px;
    margin-left: 20px;
    font-weight: bold;
    font-size: 16px;
    float: left;
  }
  .chan3>div:nth-child(2) div:nth-child(2){
    font-size: 16px;
    margin-left: 20px;
    color:#96abb4;
    float: left;
  }
  .chan3>div:nth-child(2) img{
    float: right;
    width: 50px;
    height: 50px;
    position: absolute;
    top: 10px;
    left: 100px;
  }
  .chan3>div:nth-child(3){
    background: url("/static/images/ai_key.png");
    background-size: contain;
    margin-left: 20px;
    margin-bottom: 10px;
    border-radius: 15px;
    width: 160px;
    height: 70px;
    float: left;
  }
  .chan3>div:nth-child(3) div:nth-child(1){
    padding-top: 10px;
    margin-left: 20px;
    font-weight: bold;
    font-size: 16px;
    float: left;
  }
  .chan3>div:nth-child(3) div:nth-child(2){
    font-size: 16px;
    margin-left: 20px;
    color:#96abb4;
    float: left;
  }
  //智能产品
    .chanpin{
    overflow: hidden;
    text-align: center;
    width: 100%;
  }
  .chanpin p{
    font-size: 24px;
    font-weight: bold;
  }
  .shangpin{
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left:25px;
    float: left;
    width: 40%;
    height:230px;
    box-shadow:0 0 5px #fed8e0;
  }
  .shangpin>img{
    width: 100%;
    height: 150px;
  }
  .shangpin>div:nth-child(2){
    width: 100%;
    height: 30px;
    line-height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shangpin>div:nth-child(3){
    margin-top:10px ;
    padding-left: 20px;
    text-align: left;
    color: red;
  }
  .jingxuan{
    position: relative;
  }
  .jingxuan img{
    position: absolute;
    top:20px;
    left: 170px;
    width: 150px;
    height: 150px;
  }
  .jingxuan>div:nth-child(1){
    line-height: 50px;
    padding-left: 30px;
    font-weight: bold;
    height: 50px;
    background-color: #fefaf9;
  }
  .jingxuan>div:nth-child(2){
    padding-left: 30px;
    height: 150px;
    background-color: #eee1ff;
  }
  .jingxuan>div:nth-child(2)>div:nth-child(1){
    padding-top: 50px;
  }
  .jingxuan>div:nth-child(2)>div:nth-child(2){
    padding-top: 10px;
    color: red;
    font-weight: bold;
  }
  //活动
  .active{
    width: 1000px;
    width: 100vw;
    height: 300px;
    position: relative;
    background-color: #fefaf9;
    overflow-x:scroll;
    text-align: center;
  }
  .active p{
    margin-top: 15px;
  }
  .act{
    border-radius: 10px;
    margin: 20px 10px 0 10px;
    width: 150px;
    box-shadow: 0 0 5px #fed8e0;
    height:250px;
    text-align: center;
    position: absolute;
  }
  .act img{
    border-radius: 10px;
    width: 150px;
  }
  .act div:nth-child(2){
    border-radius:0 0 5px 5px;
    height: 20px;
    background-color: #7f7f7f;
  }
  .act div:nth-child(3){
    padding: 0 10px;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .act div:nth-child(4){
    margin-left: 10px;
    text-align: left;
    color: red;
    font-weight: bold;
  }
  .act div:nth-child(5){
    margin-left: 10px;
    float: left;
    text-align: left;
    color:#7f7f7f;
    text-decoration: line-through;
  }
  .act div:nth-child(6){
    width: 20px;
    height: 20px;
    float: right;
    border: 2px solid red;
    border-radius: 20px;
    margin-right: 10px;
  }
  .more{
    height: 60px;
  }
}
</style>